package redis

import "gitee.com/injoyai/goutil/conv"

// Info interface需要包装一层
type Info struct {
	Data  interface{} //数据内容
	Count int64       //数量
	err   error       //错误
}

func newInfoErr(err error) Info {
	return Info{err: err}
}

func (this Info) List() (interface{}, int64, error) {
	return this.Data, this.Count, this.err
}

func (this Info) Info() (interface{}, error) {
	return this.Data, this.err
}

func (this Info) Err() error {
	return this.err
}

func (this Info) String() string {
	if this.err != nil {
		return "错误:" + this.err.Error()
	}
	return "内容" + conv.String(this.Data) + "	数量:" + conv.String(this.Count)
}
